//
//@File    :	6.7_not.cpp
//@Time    :	2021/08/08 10:32:32
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	using the not operator
//

#include <iostream>
#include <climits>
bool is_int(double);
int main()
{
    using namespace std;
    double num;

    cout<<"Yo,dube!Enter an integer value: ";
    cin>>num;
    while (!is_int(num))
    {
        cout<<"Out of range -- please try again: ";
        cin>>num;
    }
    int val = int (num);
    cout<<"You've entered the integer "<<val<<"\nBye\n";
    system("pause");
    return 0;
}
bool is_int(double x)
{
    if (x<=INT_MAX && x>= INT_MIN)
    {
        return true;
    }
    else
    {
        return false;
    }
}